home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 April / macformat-049.iso / mac / Shareware Plus / Developers / dropg++ / usr / include / nfs / nfsrtt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-20  |  3.8 KB  |  97 lines  |  [TEXT/R*ch]

  1. /*
  2.  * Copyright (c) 1992, 1993
  3.  *    The Regents of the University of California.  All rights reserved.
  4.  *
  5.  * This code is derived from software contributed to Berkeley by
  6.  * Rick Macklem at The University of Guelph.
  7.  *
  8.  * Redistribution and use in source and binary forms, with or without
  9.  * modification, are permitted provided that the following conditions
  10.  * are met:
  11.  * 1. Redistributions of source code must retain the above copyright
  12.  *    notice, this list of conditions and the following disclaimer.
  13.  * 2. Redistributions in binary form must reproduce the above copyright
  14.  *    notice, this list of conditions and the following disclaimer in the
  15.  *    documentation and/or other materials provided with the distribution.
  16.  * 3. All advertising materials mentioning features or use of this software
  17.  *    must display the following acknowledgement:
  18.  *    This product includes software developed by the University of
  19.  *    California, Berkeley and its contributors.
  20.  * 4. Neither the name of the University nor the names of its contributors
  21.  *    may be used to endorse or promote products derived from this software
  22.  *    without specific prior written permission.
  23.  *
  24.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  25.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  26.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  27.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  28.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  29.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  30.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  31.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  32.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  33.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  34.  * SUCH DAMAGE.
  35.  *
  36.  *    @(#)nfsrtt.h    8.1 (Berkeley) 6/10/93
  37.  */
  38.  
  39. /*
  40.  * Definitions for performance monitor.
  41.  * The client and server logging are turned on by setting the global
  42.  * constant "nfsrtton" to 1.
  43.  */
  44. #define    NFSRTTLOGSIZ    128
  45.  
  46. /*
  47.  * Circular log of client side rpc activity. Each log entry is for one
  48.  * rpc filled in upon completion. (ie. in order of completion)
  49.  * The "pos" is the table index for the "next" entry, therefore the
  50.  * list goes from nfsrtt.rttl[pos] --> nfsrtt.rttl[pos - 1] in
  51.  * chronological order of completion.
  52.  */
  53. struct nfsrtt {
  54.     int pos;            /* Position in array for next entry */
  55.     struct rttl {
  56.         int    proc;        /* NFS procedure number */
  57.         int    rtt;        /* Measured round trip time */
  58.         int    rto;        /* Round Trip Timeout */
  59.         int    sent;        /* # rpcs in progress */
  60.         int    cwnd;        /* Send window */
  61.         int    srtt;        /* Ave Round Trip Time */
  62.         int    sdrtt;        /* Ave mean deviation of RTT */
  63.         fsid_t    fsid;        /* Fsid for mount point */
  64.         struct timeval tstamp;    /* Timestamp of log entry */
  65.     } rttl[NFSRTTLOGSIZ];
  66. };
  67.  
  68. /*
  69.  * And definitions for server side performance monitor.
  70.  * The log organization is the same as above except it is filled in at the
  71.  * time the server sends the rpc reply.
  72.  */
  73.  
  74. /*
  75.  * Bits for the flags field.
  76.  */
  77. #define    DRT_NQNFS    0x01    /* Rpc used Nqnfs protocol */
  78. #define    DRT_TCP        0x02    /* Client used TCP transport */
  79. #define    DRT_CACHEREPLY    0x04    /* Reply was from recent request cache */
  80. #define    DRT_CACHEDROP    0x08    /* Rpc request dropped, due to recent reply */
  81.  
  82. /*
  83.  * Server log structure
  84.  * NB: ipadr == INADDR_ANY indicates a client using a non IP protocol.
  85.  *    (ISO perhaps?)
  86.  */
  87. struct nfsdrt {
  88.     int pos;            /* Position of next log entry */
  89.     struct drt {
  90.         int    flag;        /* Bits as defined above */
  91.         int    proc;        /* NFS procedure number */
  92.         u_long    ipadr;        /* IP address of client */
  93.         int    resptime;    /* Response time (usec) */
  94.         struct timeval tstamp;    /* Timestamp of log entry */
  95.     } drt[NFSRTTLOGSIZ];
  96. };
  97.